﻿//using DDD.Core;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore;
using DotNetCore.CAP;

namespace DDD.EFCore.SqlServer
{
    public class SqlServerPublisherTransactionHandler(ICapPublisher capPublisher) : IPublisherTransactionHandler
    {
        public IDbContextTransaction BeginTransaction(DbContext context)
        {
            return context.Database.BeginTransaction(capPublisher, autoCommit: false);
        }
    }
}
